#!/bin/bash
set -e
ulimit -n 1000000
cd "{{ deploy_dir }}" || exit 1

export RUST_BACKTRACE=1

export TZ=${TZ:-/etc/localtime}

echo -n 'sync ... '
stat=$(time sync)
echo ok
echo $stat

nohup ./bin/tidb-lightning -config ./conf/tidb-lightning.toml &> log/tidb_lightning_stderr.log &

echo $! > "status/tidb-lightning.pid"
